import type { NextConfig } from "next";
import MonacoWebpackPlugin from "monaco-editor-webpack-plugin";
import path from 'path'

const nextConfig: NextConfig = {
  /* config options here */
  webpack(config, { isServer }) {
    if (!isServer) {
      config.plugins.push(
        new MonacoWebpackPlugin({
          // 默认会包括所有的语言
          // import metadata from 'monaco-editor/esm/metadata' console.log(metadata.languages) 可获取所有的语言
          // languages: ['javascript', 'typescript']
        })
      );
    }
    return config;
  },
};

export default nextConfig;
